﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" CodeFile="DanhSachNguoiDung.aspx.cs" Inherits="Admin_DanhSachNguoiDung" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script src="../Scripts/jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#<%=txtdatecreate.ClientID%>").datepicker({ dateFormat: "dd/mm/yy", maxDate: "+0D" });
            activeMenu(3, 0);
        });
    </script>
    <div class="divsize">
        <fieldset>
            <legend>Thêm người dùng</legend>
            <asp:Label ID="LabelMessage" runat="server"></asp:Label>
            <ol class="form-clear form">
                <li>
                    <label>FullName</label>
                    <asp:TextBox ID="txtfullname" runat="server" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtfullname" CssClass="error" Display="Dynamic" ErrorMessage="RequiredFieldValidator">FullName không được để trống</asp:RequiredFieldValidator>
                </li>
                <li>
                    <label>UserName</label>
                    <asp:TextBox ID="txtusername" runat="server" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtusername" CssClass="error" Display="Dynamic" ErrorMessage="UserName hông được để trống"></asp:RequiredFieldValidator>
                </li>
                <li>
                    <label>Email</label>
                    <asp:TextBox ID="txtemail" runat="server" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtemail" CssClass="error" Display="Dynamic" ErrorMessage="Email không được để trống"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtemail" CssClass="error" Display="Dynamic" ErrorMessage="RegularExpressionValidator" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">Sai định dạng Email</asp:RegularExpressionValidator>
                </li>
                <li>
                    <label>Password</label>
                    <asp:TextBox ID="txtpassword" runat="server" TextMode="Password" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtpassword" CssClass="error" Display="Dynamic" ErrorMessage="Password không được để trống"></asp:RequiredFieldValidator>
                </li>
                <li>
                    <label>Description</label>
                    <asp:TextBox ID="txtdescription" runat="server" Width="200px"></asp:TextBox>
                </li>
                <li>
                    <label>DeaCreate</label>
                    <asp:TextBox ID="txtdatecreate" runat="server" Width="200px"></asp:TextBox>
                </li>                
                <li>
                    <label>Address</label>
                    <asp:TextBox ID="txtaddress" runat="server" Width="200px"></asp:TextBox>
                </li>
                <li>
                    <label>Phone</label>
                    <asp:TextBox ID="txtphone" runat="server" Width="200px"></asp:TextBox>
                </li>
                <li>
                    <label>&nbsp;</label>
                    <asp:Button ID="btnSave" runat="server" CssClass="btn primary" OnClick="btnSave_Click" Text="Lưu thông tin" />
                    <asp:Button ID="btnUpdate" runat="server" CssClass="btn primary" Enabled ="false" OnClick="btnUpdate_Click" Text="Sửa thông tin" />
                </li>
            </ol>
        </fieldset>
    </div>
    <div>
        <fieldset>
            <legend>Danh sách</legend>
            <asp:ListView ID="ListViewUser" runat="server" OnItemCommand="ListViewVacxin_OnItemCommand"
                OnItemDeleting="ListViewVacxin_OnItemDeleting" OnItemUpdating="ListViewVacxin_OnItemUpdating">
                <LayoutTemplate>
                    <table border="1">
                        <tr>
                            <th>ID</th>
                            <th style="width:100px">Họ tên</th>
                            <th style="width:100px">Tên đăng nhập</th>
                            <th style="width:100px">Email</th>
                            <th style="width:100px">Ngày tạo</th>
                            <th style="width:100px">Ngày sửa</th>
                            <th style="width:100px">Ngày đăng nhập</th>
                            <th style="width:100px">Mô tả</th>
                            <th style="width:100px">Địa chỉ</th>
                            <th style="width:80px">Số điện thoại</th>
                            <th style="width:100px">Thao tác</th>
                        </tr>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                    </table>
                    <asp:DataPager ID="ContactsDataPager" runat="server" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button"
                                ShowFirstPageButton="true"
                                ShowNextPageButton="false"
                                ShowPreviousPageButton="false" />
                            <asp:NumericPagerField ButtonCount="10" />
                            <asp:NextPreviousPagerField ButtonType="Button"
                                ShowLastPageButton="true"
                                ShowNextPageButton="false"
                                ShowPreviousPageButton="false" />
                        </Fields>
                    </asp:DataPager>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td><%# Eval("NguoiDungId") %></td>
                        <td><%# Eval("FullName") %></td>
                        <td><%# Eval("UserName") %></td>
                        <td><%# Eval("Email") %></td>
                        <td><%# Eval("DateCreate") %></td>
                        <td><%# Eval("DateUpdate") %></td>
                        <td><%# Eval("DateLogin") %></td>
                        <td><%# Eval("Description") %></td>
                        <td><%# Eval("Address") %></td>
                        <td><%# Eval("Phone") %></td>
                        <td >
                            
                            <asp:LinkButton ID="LinkButtonXoa" ToolTip="Xóa một bản ghi" runat="server" CommandArgument='<%# Eval("NguoiDungId") %>'
                                CommandName="Delete" ForeColor="Brown" OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')">Xóa</asp:LinkButton>
                            |
                            <asp:LinkButton ID="LinkButtonSua" ToolTip="Sửa thông tin" runat="server" CommandArgument='<%# Eval("NguoiDungId") %>'
                                CommandName="Update">Chi tiết</asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </fieldset>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <ul class="m-melanin-vertical-navigation">
        <li>
            <span class=" ss_sprite ss_user">&nbsp;</span>
            <a href="DanhSachNguoiDung.aspx" title="Click here to access security Control Panel" class="" id="User">
                <span>Danh sách người dùng</span>
            </a>
        </li>
       <%-- <li>
            <span class=" ss_sprite ss_user">&nbsp;</span>
            <a href="NhanVien.aspx" title="Click here to access security Control Panel" class="" id="employee">
                <span>Danh sách nhân viên</span>
            </a>
        </li>--%>
    </ul>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">
    <asp:Button ID="button_create_user" runat="server" CssClass="btn small primary" Text="Thêm người dùng" />
</asp:Content>
